using System;

namespace RapidHDL
{
	/// <summary>
	/// Summary description for ComponentSharedDataCoordinator.
	/// </summary>
	public class ComponentSharedDataCoordinator
	{
		System.Collections.Hashtable oSharedData;

		public ComponentSharedDataCoordinator()
		{
			oSharedData = new System.Collections.Hashtable();		
		}

		public ComponentSharedData GetSharedData(string psName)
		{
			if (oSharedData.ContainsKey(psName.ToUpper()))
				return (ComponentSharedData)oSharedData[psName.ToUpper()];
			else
				return null;
		}

		void CacheSharedData(string psName, ComponentSharedData poSharedData)
		{
			oSharedData.Add(psName,poSharedData);

			InputNodeVectors = new System.Collections.Hashtable();
			OutputNodeVectors = new System.Collections.Hashtable();
			ConnectionOnlyNodeVectors = new System.Collections.Hashtable();
			RedundantNodeVectors = new System.Collections.Hashtable();
		}
	}	
}
